package cn.designmode.adapter;

public class Main {
    public static void main(String[] args) {
        // 一个示例使用适配器模式将 Book、Movie 转换为 Media
        Book book = new Book();
        book.setTitle("Java Design Patterns");
        book.setAuthor("Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides");

        Movie movie = new Movie();
        movie.setTitle("The Social Network");
        movie.setDirector("David Fincher");
        movie.setReleaseDate("2010-09-24");
        Target adapter = new Adapter(new AdapteeHandler());
        Media media1 = adapter.request(book);
        Media media2 = adapter.request(movie);
        System.out.println(media1);
        System.out.println(media2);
    }
}